Conversation
ddaspit
left a comment
There was a problem hiding this comment.
Reviewed 18 of 18 files at r1, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @ddaspit)
src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/CompoundingRule.cs line 45 at r1 (raw file):
public FeatureStruct NonHeadRequiredSyntacticFeatureStruct { get; set; } public MprFeatureSet HeadProdRestrictionsMprFeatureSet { get; set; }
I would rename this to HeadProdRestrictionsMprFeatures, so that it is consistent with existing names.
src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/CompoundingRule.cs line 68 at r1 (raw file):
} public bool CompoundMprFeaturesMatch(MprFeatureSet ruleMprFeatures, MprFeatureSet stemMprFeatures)
I would prefer that this method was moved to the MprFeatureSet class.
src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/CompoundingRule.cs line 70 at r1 (raw file):
public bool CompoundMprFeaturesMatch(MprFeatureSet ruleMprFeatures, MprFeatureSet stemMprFeatures) { if (ruleMprFeatures.Count > 0)
This method could be simplified to
return ruleMprFeatures.Count == 0 || ruleMprFeatures.Intersect(stemMprFeatures).Any();src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/AnalysisCompoundingRule.cs line 84 at r1 (raw file):
if (_morpher.TraceManager.IsTracing) { var tempInput = new Word(allo, null);
Would the following be a more correct representation of the input word?
Word tempInput = outWord.Clone();
tempInput.CurrentNonHead.RootAllomorph = allo;src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/AnalysisCompoundingRule.cs line 86 at r1 (raw file):
var tempInput = new Word(allo, null); tempInput.CurrentTrace = input.CurrentTrace; _morpher.TraceManager.MorphologicalRuleNotApplied(
I don't think this is the correct trace entry type. Do we need a new trace entry type to represent this case?
Machine.sln line 51 at r1 (raw file):
GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64
Is there some reason why you added a configuration specifically for x64? I don't think it should be necessary.
|
Thank you for the suggestions. Very helpful.
Well, CompoundingRule implements IMorphologicalRule, right? Do we need to make a distinction here? |
ddaspit
left a comment
There was a problem hiding this comment.
Do we want to add support for these new properties to the XML config file?
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @AndyBlack)
src/SIL.Machine.Morphology.HermitCrab/MorphologicalRules/AnalysisCompoundingRule.cs line 86 at r1 (raw file):
Previously, AndyBlack (Andy Black) wrote…
var tempInput = new Word(allo, null); tempInput.CurrentTrace = input.CurrentTrace; _morpher.TraceManager.MorphologicalRuleNotApplied(I don't think this is the correct trace entry type. Do we need a new trace entry type to represent this case?
Well, CompoundingRule implements IMorphologicalRule, right? Do we need to make a distinction here?
You are correct, but this is actually rule unapplication, since it occurs during the analysis phase. Calling MorphologicalRuleNotUnapplied might be more appropriate, but that is already called at the end if the rule doesn't produce any outputs. The case you are trying to log here is a bit different. You want to log the case where the rule doesn't unapply for a specific nonhead allomorph, because it doesn't match the MPR features. The rule might still unapply in other cases for the same input. As a result, this feels like a special trace entry type that doesn't fit any of the existing types.
|
Yes, we need to add these to the XML config. Good point. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #312 +/- ##
==========================================
- Coverage 70.79% 70.75% -0.05%
==========================================
Files 390 390
Lines 32715 32806 +91
Branches 4604 4612 +8
==========================================
+ Hits 23162 23213 +51
- Misses 8489 8527 +38
- Partials 1064 1066 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@ddaspit Damien, could you review these latest changes, please? Thanks. |
ddaspit
left a comment
There was a problem hiding this comment.
Everything looks good. You still need to revert the changes to Machine.sln.
Reviewed 13 of 13 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AndyBlack)
Machine.sln line 51 at r1 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Is there some reason why you added a configuration specifically for x64? I don't think it should be necessary.
There still seems to be a bunch of extra configurations for other projects in the solution. Can you revert all of the changes in this file? Thanks.
ddaspit
left a comment
There was a problem hiding this comment.
Reviewed 12 of 12 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @AndyBlack)
ddaspit
left a comment
There was a problem hiding this comment.
Reviewed all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @AndyBlack)
Added MprFeatureSets for head and nonhead portions of compound rules
Added tests to see if a head/nonhead portion of a compound rule requires one or more productivity restrictions that at least one of those restrictions is present in the head/nonhead.
When analyzing and tracing, if such a requirement failed, add a failure message about needed nonhead productivity restrictions.
When synthesizing and tracing, if such a requirement failed, add a failure message about needed head productivity restrictions.
This change is